#登录页面

from selenium.webdriver.common.by import By
#导入页面基类
from utils.page_base import PageBase

class PageUi2(PageBase):
    path_url="/simple/login"
    loc_zanhao=By.NAME,"login_info"
    loc_pwd=By.NAME,"password"
    loc_login=By.CLASS_NAME,"input_submit"
    loc_errorTip=By.CSS_SELECTOR,"div.prompt"

    def __init__(self,driver,base_url):
        PageBase.__init__(self,driver,base_url)

        # 打开本页面

    def openUrl(self):
        self.open(PageUi2.path_url)

    #输入账号
    def input_zanhao(self,zanhao):
        self.input(PageUi2.loc_zanhao,zanhao)

    #输入密码
    def input_pwd(self,pwd):
        self.input(PageUi2.loc_pwd,pwd)

    #点击登录按钮
    def click_login(self):
        self.click(PageUi2.loc_login)

    #获取错误提示div的文本内容
    def getErrorTipText(self):
        return self.getEleText(PageUi2.loc_errorTip)

    #获取账号文本框的class属性的值
    def getEleZanhaoClass(self):
        return self.getEleAttr(PageUi2.loc_zanhao,"class")



